home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 4
/
Gold Medal Software - Volume 4 (Gold Medal) (1994).iso
/
menuts
/
hdmm468.arj
/
ZIPLOG.BAT
< prev
Wrap
DOS Batch File
|
1994-05-22
|
2KB
|
77 lines
ECHO OFF
CLS
REM This program can archive and retrieve any file but was designed for
REM storing HDM.LOG originally. The programs PKZIP, PKUNZIP, GET, PCOPY,
REM PDEL, and MORE are needed in the DOS path for this program to work.
IF %1. == EXTRACT. GOTO :EXTRACT
IF %1. == . GOTO :HELP
C:
CD\
IF NOT EXIST %1 GOTO :HELP
GET HE 14
DIR %1
ECHO
GET C "ZIP/Move (-m) %1 to C:\MENU\ZIPLOG.ZIP (Y/N)? " YN /15
IF NOT %GET%. == Y. GOTO :EXIT
GET HE 14
MD %GET%
COPY %1 %GET%
IF EXIST %GET%\*.* PKZIP C:\MENU\ZIPLOG %GET%\*.* -M -P
IF EXIST %GET%\PRN REM RD %GET%
DEL %1
IF NOT %1. == C:\MENU\HDM.LOG GOTO :EXIT
ECHO ≡ > \MENU\HDM.LOG
GOTO :EXIT
:HELP
ECHO ZIPLOG.BAT samples and help screen
ECHO ZIPLOG drive:\dir\filename.ext
ECHO ZIPLOG EXTRACT
ECHO
ECHO This batch file can either place files in HDMZIP.LOG or it can extract
ECHO files from HDMZIP.LOG. The HDMZIP.LOG file is assumed to be in C:\MENU.
ECHO You must specify a drive:\dir\filename.ext to move to ZIPLOG.ZIP or
ECHO you may view/extract a file by running ZIPLOG EXTRACT.
ECHO
ECHO To add/move a file this BATCH file uses GET to create a directory
ECHO using the current computer date then moves the filename.ext into that
ECHO directory. Then PKZIP is called to create or add to ZIPLOG.ZIP moving
ECHO all files from the date\*.* directory. ZIPLOG then removes the directory.
ECHO
ECHO To view/extract a file ZIPLOG calls PKUNZIP to view the contents of
ECHO ZIPLOG.ZIP using the DOS command MORE. Then GET is used to take the
ECHO dir\filename.ext to extract (if you want to extract). Then ZIPLOG
ECHO checks to make sure that directory\filename.ext does not exit. ZIPLOG
ECHO then asks for the destination directory. It then proceeds to extract
ECHO the file and move it to the desired destination using PCOPY & PDEL.
ECHO
PAUSE
GOTO :EXIT
:EXTRACT
GET Y
SET DIR=GET
IF NOT EXIST \MENU\ZIPLOG.ZIP GOTO :EXIT
PKUNZIP -VB \MENU\ZIPLOG.ZIP | MORE
ECHO
GET ZE "Extract which dir\filename.ext (Note: use \ not /)? "
IF %GET%. == . GOTO :EXIT
SET FILE=%GET%
IF NOT EXIST %FILE% GOTO :PLACE
:EXISTS
GET C "The entry '%FILE%' already exists! Replace (Y/N)? " YN
IF %GET%. == N. GOTO :EXIT
:PLACE
GET ZE "Place in which directory? "
IF %GET%. == . SET GET=%DIR%
PKUNZIP \MENU\ZIPLOG %FILE% -d -o
IF NOT EXIST %FILE% GOTO :EXIT
IF NOT %FILE%. == %GET%. PCOPY %FILE% %GET% /EQ
PDEL %FILE% /DE /EQ
DIR %GET%
PAUSE
:EXIT
SET GET=
SET FILE=
SET DIR=